package com.simen.hellobytes.socket;

/**
 * @author Created by Simen.
 * @date 创建日期 2018/5/25 13:20
 * @modify 修改者 Simen
 */
public class AbstractSocket {

    private static final int DEFAULT_TIMEOUT = -1;
    private static final int DEFAULT_BUFSIZE = 1024;

    protected int mAcceptTimeout = DEFAULT_TIMEOUT;
    protected int mConnectTimeout = DEFAULT_TIMEOUT;
    protected int mReadTimeout = DEFAULT_TIMEOUT;

    protected boolean reuseAddress = false;

    protected int bufSize = DEFAULT_BUFSIZE;

    protected int recSocketBufSize = -1;
    protected int sendSocketBufSize = -1;

    public int getAcceptTimeout() {
        return mAcceptTimeout;
    }

    public void setAcceptTimeout(int acceptTimeout) {
        this.mAcceptTimeout = acceptTimeout;
    }

    public int getConnectTimeout() {
        return mConnectTimeout;
    }

    public void setConnectTimeout(int timeout) {
        this.mConnectTimeout = timeout;
    }

    public int getReadTimeout() {
        return mReadTimeout;
    }

    public void setReadTimeout(int readTimeout) {
        this.mReadTimeout = readTimeout;
    }

    public boolean isReuseAddress() {
        return reuseAddress;
    }

    public void setReuseAddress(boolean reuseAddress) {
        this.reuseAddress = reuseAddress;
    }

    public int getBufSize() {
        return bufSize;
    }

    public void setBufSize(int bufSize) {
        this.bufSize = bufSize;
    }

    public int getRecSocketBufSize() {
        return recSocketBufSize;
    }

    public void setRecSocketBufSize(int recSocketBufSize) {
        this.recSocketBufSize = recSocketBufSize;
    }

    public int getSendSocketBufSize() {
        return sendSocketBufSize;
    }

    public void setSendSocketBufSize(int sendSocketBufSize) {
        this.sendSocketBufSize = sendSocketBufSize;
    }
}
